﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Default.master" AutoEventWireup="true" CodeFile="TrangChu.aspx.cs" Inherits="Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">

</asp:Content>


<asp:Content ID="Content2" ContentPlaceHolderID="MainBody" runat="Server">

    <asp:SqlDataSource ID="SqlDataSourceTenLoaiSanPham" runat="server" ConnectionString="<%$ ConnectionStrings:DefaultDatabase %>"
        SelectCommand="select TenLoaiSanPham from LOAISANPHAM where MaLoaiSanPham=@MLSP">
        <SelectParameters>
            <asp:QueryStringParameter Name="MLSP" QueryStringField="MLSP" Type="String" DefaultValue="0" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDS_LoadProduct" runat="server" ConnectionString="<%$ ConnectionStrings:DefaultDatabase %>"
        SelectCommand="select c.TenTaiKhoan,TenLoaiSanPham,TenSanPham,MaSanPham,NgayHetHan,GiaHienTai,HinhAnh,a.MaTaiKhoan from SANPHAM a, LOAISANPHAM b,TAIKHOAN c where a.MaLoaiSanPham=@MLSP and b.MaLoaiSanPham = a.MaLoaiSanPham and c.MaTaiKhoan=a.MaTaiKhoan and DATEDIFF(day, NgayHetHan, GetDate()) <= 0">
        <SelectParameters>
            <asp:QueryStringParameter Name="MLSP" QueryStringField="MLSP" Type="String" DefaultValue="0" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:Panel ID="panelLoaiSanPham" runat="server" Visible="false">
        <div class="Windows">
            <span id="capture">
                <asp:DataList ID="dtlistLSP" runat="server" DataSourceID="SqlDataSourceTenLoaiSanPham"
                    RepeatColumns="4">
                    <ItemTemplate>
                        Loại sản phẩm: <%#Eval("TenLoaiSanPham")%>
                    </ItemTemplate>
                </asp:DataList>
            </span>
            <asp:DataList ID="dtlist" runat="server" DataSourceID="SqlDS_LoadProduct" RepeatColumns="4">
                <ItemTemplate>
                    <div class="auction padding0">
                        <div class="producName">
                            <a class="blue" title="Phiên đấu giá không giới hạn" href="/dau-gia-sieu-re-truc-tuyen/ve-vua-dau-gia/ve-thuong-dan-21064.html">
                                <%#Eval("TenSanPham")%></a>
                        </div>
                        <div class="producPic">
                            <a href='<%# Eval("MaSanPham", "Detail.aspx?MSP={0}") %>'>
                                <img src="./productImgs/<%#Eval("MaTaiKhoan")%>/<%#Eval("HinhAnh")%>" alt="hinh anh san pham" />
                            </a>
                        </div>
                        <span class="countdown">
                            <label>Ngày hết hạn</label><span><%#Eval("NgayHetHan")%></span> 
                        </span>                        
                        <span class="price green"><%#Eval("GiaHienTai")%><span class="vnd">₫</span></span>
                        <span class="bidder">
                             <span id="tenthanhvien"><asp:LinkButton runat="server" ID="userNameLink" PostBackUrl="~/Default1.aspx" Text='<%#Eval("TenTaiKhoan")%>'> </asp:LinkButton></span>
                        </span>                        
                        <span class="bidButton"> <a href='<%# Eval("MaSanPham", "Detail.aspx?MSP={0}") %>' class="sold">Đặt giá</a></span>
                        
                    </div>
                </ItemTemplate>
            </asp:DataList>
        </div>
    </asp:Panel>
    <asp:Panel ID="panelDauGiaNhieuNhat" runat="server" Visible="false">
        <div class="Windows">
            <span id="capture">Sản phẩm đấu giá nhiều nhất</span>
            <asp:Repeater ID="rptHotProducts" runat="server">
                <ItemTemplate>
                    <div class="auction padding0">
                        <div class="producName">
                            <a class="blue" title="Phiên đấu giá không giới hạn BID" href="/dau-gia-sieu-re-truc-tuyen/ve-vua-dau-gia/ve-thuong-dan-21064.html">
                                <%#Eval("TenSanPham")%></a>
                        </div>
                        <div class="producPic">
                            <a href='<%# Eval("MaSanPham", "Detail.aspx?MSP={0}") %>'>
                                <img src="./productImgs/<%#Eval("MaTaiKhoan")%>/<%#Eval("HinhAnh")%>" alt="hinh anh san pham" />
                            </a>
                        </div>
                        <span class="countdown">
                            <label>Ngày hết hạn</label><span><%#Eval("NgayHetHan")%></span> 
                        </span>                        
                        <span class="price green"><%#Eval("GiaHienTai")%><span class="vnd">₫</span></span>
                        <span class="bidder">
                             <span id="tenthanhvien"><asp:LinkButton runat="server" ID="userNameLink" PostBackUrl="~/Default1.aspx" Text='<%#Eval("TenTaiKhoan")%>'> </asp:LinkButton></span>
                        </span>                        
                        <span class="bidButton"> <a href='<%# Eval("MaSanPham", "Detail.aspx?MSP={0}") %>' class="sold">Đặt giá</a></span>
                        
                    </div>
                </ItemTemplate>
            </asp:Repeater>
            <div class="vide">
            </div>
        </div>
    </asp:Panel>
    <asp:Panel ID="panelHotProduct" runat="server" Visible="false">
        <div class="Windows">
            <span id="capture">Sản phẩm mới nhất</span>
            <asp:Repeater ID="RepeaterNewProducts" runat="server">
                <ItemTemplate>
                    <div class="auction padding0">
                        <div class="producName">
                            <a class="blue" title="Phiên đấu giá không giới hạn BID" href="/dau-gia-sieu-re-truc-tuyen/ve-vua-dau-gia/ve-thuong-dan-21064.html">
                                <%#Eval("TenSanPham")%></a>
                        </div>
                        <div class="producPic">
                            <a href='<%# Eval("MaSanPham", "Detail.aspx?MSP={0}") %>'>
                                <img src="./productImgs/<%#Eval("MaTaiKhoan")%>/<%#Eval("HinhAnh")%>" alt="hinh anh san pham" />
                            </a>
                        </div>
                        <span class="countdown">
                            <label>Ngày hết hạn</label><span><%#Eval("NgayHetHan")%></span> 
                        </span>                        
                        <span class="price green"><%#Eval("GiaHienTai")%><span class="vnd">₫</span></span>
                        <span class="bidder">
                             <span id="tenthanhvien"><asp:LinkButton runat="server" ID="userNameLink" PostBackUrl="~/Default1.aspx" Text='<%#Eval("TenTaiKhoan")%>'> </asp:LinkButton></span>
                        </span>                        
                        <span class="bidButton"> <a href='<%# Eval("MaSanPham", "Detail.aspx?MSP={0}") %>' class="sold">Đặt giá</a></span>
                        
                    </div>
                </ItemTemplate>
            </asp:Repeater>
            <div class="vide">
            </div>
        </div>
    </asp:Panel>
</asp:Content>
